/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.esmp.sysml.componentmodel.profile.rtos.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.esmp.sysml.componentmodel.profile.rtos.DSmodelRunnable;
import org.esmp.sysml.componentmodel.profile.rtos.RTOSPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>DSmodel Runnable</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.esmp.sysml.componentmodel.profile.rtos.impl.DSmodelRunnableImpl#getBlockDiagram <em>Block Diagram</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DSmodelRunnableImpl extends RunnableImpl implements DSmodelRunnable {
	/**
	 * The default value of the '{@link #getBlockDiagram() <em>Block Diagram</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBlockDiagram()
	 * @generated
	 * @ordered
	 */
	protected static final String BLOCK_DIAGRAM_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getBlockDiagram() <em>Block Diagram</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBlockDiagram()
	 * @generated
	 * @ordered
	 */
	protected String blockDiagram = BLOCK_DIAGRAM_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DSmodelRunnableImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return RTOSPackage.Literals.DSMODEL_RUNNABLE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getBlockDiagram() {
		return blockDiagram;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBlockDiagram(String newBlockDiagram) {
		String oldBlockDiagram = blockDiagram;
		blockDiagram = newBlockDiagram;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, RTOSPackage.DSMODEL_RUNNABLE__BLOCK_DIAGRAM, oldBlockDiagram, blockDiagram));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case RTOSPackage.DSMODEL_RUNNABLE__BLOCK_DIAGRAM:
				return getBlockDiagram();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case RTOSPackage.DSMODEL_RUNNABLE__BLOCK_DIAGRAM:
				setBlockDiagram((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case RTOSPackage.DSMODEL_RUNNABLE__BLOCK_DIAGRAM:
				setBlockDiagram(BLOCK_DIAGRAM_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case RTOSPackage.DSMODEL_RUNNABLE__BLOCK_DIAGRAM:
				return BLOCK_DIAGRAM_EDEFAULT == null ? blockDiagram != null : !BLOCK_DIAGRAM_EDEFAULT.equals(blockDiagram);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (blockDiagram: ");
		result.append(blockDiagram);
		result.append(')');
		return result.toString();
	}

} //DSmodelRunnableImpl
